//
//  KLRefreshHeader.m
//  WisdomFamilyDoctor
//
//  Created by jinglian on 16/3/18.
//  Copyright © 2016年 kinglian. All rights reserved.
//

#import "KLRefreshHeader.h"

@interface KLRefreshHeader ()
/** logo */
@property (nonatomic, strong) UIImageView *logoImageView;
@end

@implementation KLRefreshHeader

- (void)prepare {
    [super prepare];
    
    self.automaticallyChangeAlpha = YES;
    
    self.lastUpdatedTimeLabel.hidden = YES;
    
    self.stateLabel.font = [UIFont systemFontOfSize:13.0f];
    
    [self setTitle:@"下拉刷新" forState:MJRefreshStateIdle];
    [self setTitle:@"释放更新" forState:MJRefreshStatePulling];
    [self setTitle:@"加载中..." forState:MJRefreshStateRefreshing];
    
//    [self addSubview:self.logoImageView];
}

#pragma mark 在这里设置子控件的位置和尺寸

- (void)placeSubviews {
    [super placeSubviews];
    
    self.logoImageView.frame = CGRectMake(0, -44, kScreenWidth, 44);
}

- (UIImageView *)logoImageView {
    if (!_logoImageView) {
        _logoImageView = [[UIImageView alloc] init];
        _logoImageView.contentMode = UIViewContentModeScaleAspectFit;
        _logoImageView.image = [UIImage imageNamed:@"ic_refresh_head_logo"];
    }
    return _logoImageView;
}

@end
